 /**
 * layui首页配置
 * @license MIT
 * @Author Malphite
 * @Date 2023-08-03
 */
layui.config({base: './js/'})
     .extend({
         post: './post',
         postAdd: './postAdd',
         postUpdate: './postUpdate',
         chart: './chart',
         chartAdd: './chartAdd',
         chartUpdate: './chartUpdate',
         chartShow: './chartShow',
         user: './user',
         userAdd: './userAdd',
         userUpdate: './userUpdate',
     });
// TODO 后台地址，需要灵活配置 (这里取nginx里面配置的地址)
const LAYER_BASE_URL = "./layui";
// 公钥与KeyPair里面的公钥进行配对
const LAYER_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKY09eWbK+WI2yd/DlBI5GS6Ni08zzEdty/T4sFt74HSBdnySnDnVWOmyN1ZyEHjBuy5vfoJZ3oZQzjdNYJQKvQPN0Qp72ySixPM0WpKiNa81UuPtxeYo772UxgmqXabte7fqzR4zZtNCh06U/knjyPr9SX//SDFQcNK/4UGvQKwIDAQAB";
// 登录token缓存的key
const LAYUI_USER_FIELD = "layui-user-field";
// 聚合搜索配置参数
const MAP = {
    Post:{
        name: "Post",
        mark: "帖子",
        parse: function(data){
            return [
              {name: "id",value: data["id"]},
              {name: "标题",value: data["title"]},
              {name: "内容",value: data["content"]},
              {name: "标签列表（json 数组）",value: data["tags"]},
              {name: "点赞数",value: data["thumbnum"]},
              {name: "收藏数",value: data["favournum"]},
              {name: "创建用户 id",value: data["userid"]},
              {name: "创建时间",value: data["createtime"]},
              {name: "更新时间",value: data["updatetime"]},
              {name: "是否删除",value: data["isdelete"]},
           ];
       },
       title: function(data){
           return data["title"];
       },
    },
    Chart:{
        name: "Chart",
        mark: "图表信息表",
        parse: function(data){
            return [
              {name: "id",value: data["id"]},
              {name: "分析目标",value: data["goal"]},
              {name: "图表名称",value: data["name"]},
              {name: "图表数据",value: data["chartdata"]},
              {name: "图表类型",value: data["charttype"]},
              {name: "生成的图表数据",value: data["genchart"]},
              {name: "生成的分析结论",value: data["genresult"]},
              {name: "状态",value: data["status"]},
              {name: "执行信息",value: data["execmessage"]},
              {name: "创建用户 id",value: data["userid"]},
              {name: "创建时间",value: data["createtime"]},
              {name: "更新时间",value: data["updatetime"]},
              {name: "是否删除",value: data["isdelete"]},
           ];
       },
       title: function(data){
           return data["name"];
       },
    },
    User:{
        name: "User",
        mark: "用户",
        parse: function(data){
            return [
              {name: "id",value: data["id"]},
              {name: "账号",value: data["useraccount"]},
              {name: "密码",value: data["userpassword"]},
              {name: "用户昵称",value: data["username"]},
              {name: "用户头像",value: data["useravatar"]},
              {name: "用户角色：user/admin",value: data["userrole"]},
              {name: "创建时间",value: data["createtime"]},
              {name: "更新时间",value: data["updatetime"]},
              {name: "是否删除",value: data["isdelete"]},
           ];
       },
       title: function(data){
           return data["username"];
       },
    },
};
// 弹出层配置参数
const LAYER_CONFIG = {
    post: {
        name: '帖子基础信息',
        url: './html/post.html',
        area: ["880px", "670px"],
        pid: 1,
    },
    postAdd: {
        name: '添加帖子',
        url: './html/postAdd.html',
        area: ["750px", "325px"],
    },
    postUpdate: {
        name: '修改帖子',
        url: './html/postUpdate.html',
        area: ["750px", "325px"],
    },
    chart: {
        name: '图表信息表基础信息',
        url: './html/chart.html',
        area: ["880px", "670px"],
        pid: 1,
    },
    chartAdd: {
        name: '添加图表信息表',
        url: './html/chartAdd.html',
        area: ["750px", "320px"],
    },
    chartUpdate: {
        name: '修改图表信息表',
        url: './html/chartUpdate.html',
        area: ["750px", "320px"],
    },
    chartShow: {
        name: '展示图表信息表',
        url: './html/chartShow.html',
        area: ["750px", "370px"],
    },
    user: {
        name: '用户基础信息',
        url: './html/user.html',
        area: ["880px", "670px"],
        pid: 1,
    },
    userAdd: {
        name: '添加用户',
        url: './html/userAdd.html',
        area: ["750px", "280px"],
    },
    userUpdate: {
        name: '修改用户',
        url: './html/userUpdate.html',
        area: ["750px", "280px"],
    },
};